<template>
	<div class="tarbars">
		<u-tabbar :value="value1" @change="change1" :fixed="true" border :placeholder="true"
			:safeAreaInsetBottom="true">
			<u-tabbar-item v-for="item in menuList" :key="item.text" :text="item.text" :icon="item.icon"
				@click="click1">
			</u-tabbar-item>
		</u-tabbar>
	</div>
</template>

<script>
	export default {
		name: "",
		props: {
			value1: {
				type: Number,
				default: 0,
			},
		},
		data() {
			return {
				menuList: [{
						pagePath: "pages/index/index",
						iconPath: "static/icon/home.png",
						selectedIconPath: "static/icon/home-black.png",
						text: "主页",
						icon: "home",
					},
					{
						pagePath: "pages/friends/friends",
						iconPath: "static/icon/friendadd.png",
						selectedIconPath: "static/icon/friendadd-black.png",
						text: "好友",
						icon: "man-add",
					},
					{
						pagePath: "pages/mine/mine",
						iconPath: "static/icon/mine.png",
						selectedIconPath: "static/icon/frends-black.png",
						text: "我的",
						icon: "account-fill",
					},
				],
			};
		},
		beforeCreate() {},
		created() {},
		beforeMount() {},
		mounted() {},
		computed: {},
		watch: {},
		methods: {
			click1(e) {
				console.log("click1", e);
			},
			change1(e) {
				this.value1 = e;
				console.log(e, "change1");
				uni.navigateTo({
					url: "/" + this.menuList[e].pagePath,
				});
			},
		},
	};
</script>

<style scoped lang="less"></style>